package com.demo.download.dao

import androidx.room.Room
import androidx.room.migration.Migration
import com.demo.download.app.App

/**
 * Author:  Tomato.wl
 * CreateDate:    2020/3/16 17:29
 */
object RoomClient {

    private const val DATA_BASE_NAME = "download.db"

    val dataBase: AppDataBase by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
        Room
            .databaseBuilder(
                App.instance.applicationContext,
                AppDataBase::class.java,
                DATA_BASE_NAME
            )
            .build()
    }

    private fun createMigrations(): Array<Migration> {
        return arrayOf()
    }

}